import React, { SFC, useState } from 'react';
import Bar, { Types } from './Bar/Bar';

const Radio: SFC = () => {
    const [playState, setPlayStatus] = useState<boolean>(false);
    function onBarClick(type: Types) {
        if (type === 'status') {
            setPlayStatus(!playState);
        }
        if (type === 'play') {
            setPlayStatus(true);
        }
        if (type === 'list') {
            console.log('list');
        }
    }
    return (
        <div style={{ marginBottom: 20 }}>
            <Bar played={playState} onClick={onBarClick} />
        </div>
    );
};
export default Radio;
